package cn.wolfcode.luowowo.article.mapper;

import cn.wolfcode.luowowo.article.domain.StrategyDetail;
import cn.wolfcode.luowowo.common.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyDetail record);

    StrategyDetail selectByPrimaryKey(Long id);

    List<StrategyDetail> selectAll();

    int updateByPrimaryKey(StrategyDetail record);

    //攻略文章管理的分页
    List<StrategyDetail> selectForList(QueryObject qo);

    //根据文章的id删除关系
    void deleteRelation(Long detailId);

    //添加关系
    void insertRelation(@Param("detailId") Long detailId, @Param("tagId") Long tagId);

    //查询分类下点击量前3的文章
    List<StrategyDetail> selectviewnumTop3(Long destId);

    //更新文章的统计数据
    void updateStats(StrategyDetail detail);
}